package com.ccc.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Fund entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "fund")
public class Fund implements java.io.Serializable {

	// Fields

	private Integer fundId;
	private User user;
	private Integer currentTime;
	private Integer cash;
	private Integer totalLoan;

	// Constructors

	/** default constructor */
	public Fund() {
	}

	/** full constructor */
	public Fund(User user, Integer currentTime, Integer cash, Integer totalLoan) {
		this.user = user;
		this.currentTime = currentTime;
		this.cash = cash;
		this.totalLoan = totalLoan;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "fundId", unique = true, nullable = false)
	public Integer getFundId() {
		return this.fundId;
	}

	public void setFundId(Integer fundId) {
		this.fundId = fundId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "currentTime", nullable = false)
	public Integer getCurrentTime() {
		return this.currentTime;
	}

	public void setCurrentTime(Integer currentTime) {
		this.currentTime = currentTime;
	}

	@Column(name = "cash", nullable = false)
	public Integer getCash() {
		return this.cash;
	}

	public void setCash(Integer cash) {
		this.cash = cash;
	}

	@Column(name = "totalLoan", nullable = false)
	public Integer getTotalLoan() {
		return this.totalLoan;
	}

	public void setTotalLoan(Integer totalLoan) {
		this.totalLoan = totalLoan;
	}

}